package com.dcbeida.model;

import com.dcbeida.MyApplication;
import com.dcbeida.utils.GenApiHashUrl;
import com.dcbeida.utils.JsonGet;

import dc.medicine.com.okhttplib.OkHttpUtils;
import dc.medicine.com.okhttplib.callback.AbsCallback;

/**
 * Sean
 */
public class SignModel {

    private static SignModel mModel;

    private SignModel() {

    }

    public static SignModel newInstance() {
        if (mModel == null) {
            return new SignModel();
        } else {
            return mModel;
        }
    }

    public void getSignQrCode(int patientid, AbsCallback mAbsCallback) {
        JsonGet jg = new JsonGet()
                .putopt("patientid",patientid);
        String json = jg.tostring();
        OkHttpUtils.getInstance().post(GenApiHashUrl.apiUrl).tag(this)
                .paramsApp("service", "getSignQrCode")
                .paramsApp("params", json).execute(mAbsCallback);
    }

    public void rejectSign(int patientid, AbsCallback mAbsCallback) {
        JsonGet jg = new JsonGet()
                .putopt("patientid",patientid);
        String json = jg.tostring();
        OkHttpUtils.getInstance().post(GenApiHashUrl.apiUrl).tag(this)
                .paramsApp("service", "rejectSign")
                .paramsApp("params", json).execute(mAbsCallback);
    }


    public void getCancel() {
        OkHttpUtils.getInstance().cancelTag(this);
    }
}
